package com.tyk.bookstore.back.auth.model.query;

import com.tyk.bookstore.back.auth.model.type.CaptchaLoginType;
import com.tyk.bookstore.back.auth.valid.group.EmailValidGroup;
import com.tyk.bookstore.back.auth.valid.group.MobilePhoneValidGroup;
import com.tyk.bookstore.back.auth.valid.provider.SendCaptchaQueryGroupValidProvider;
import com.tyk.bookstore.back.common.core.valid.annotation.EmailValid;
import com.tyk.bookstore.back.common.core.valid.annotation.MobilePhoneValid;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.group.GroupSequenceProvider;

@GroupSequenceProvider(SendCaptchaQueryGroupValidProvider.class)
@Data
public class SendMsgCodeQuery {

	@Schema(description = "认证主体: 账号、手机号、邮箱")
	@NotBlank
	@MobilePhoneValid(groups = { MobilePhoneValidGroup.class })
	@EmailValid(groups = { EmailValidGroup.class })
	private String principal;

	@Schema(description = "由阿里云验证码2.0脚本产生的验证参数")
	@NotBlank
	private String captchaVerifyParam;

	@Schema(description = "验证码登录表单类型：1手机号、2邮箱", type = "integer")
	@NotNull
	private CaptchaLoginType type;

}
